package com.jysz.certificate.persistence.enums.cs;


/**
 * 来源
 * @author xuxiaolong
 */
public enum CheckStockSource {
	AREA("区域经理", 0), SUPERVISION("监管科", 1), HEADQUARTERS("总部", 2);
	
	// 名称
	private String name;
	// 索引
	private int index;
	
	private CheckStockSource(String name, int index) {
		this.name = name;
		this.index = index;
	}
	
	// 根据索引获得名称
	public static String getName(int index) {
		for (CheckStockSource w : CheckStockSource.values()) {
			if (w.getIndex() == index) {
				return w.name;
			}
		}
		return null;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public int getIndex() {
		return index;
	}
	
	public void setIndex(int index) {
		this.index = index;
	}
}